<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户登陆界面</title>
    
	<link rel="stylesheet" type="text/css" href="css/login.css">
	
	<script type="text/javascript" src="dwr/engine.js"></script>
	<script type="text/javascript" src="dwr/util.js"></script>
	<script type="text/javascript" src="dwr/interface/loginAjax.js"></script>
	
	<script type="text/javascript" >
	function login() {
		var loginMap = dwr.util.getValues("loginForm");
		loginAjax.login(loginMap , loginCallback);
	}

	function loginCallback(data) {
		if(data == 'true') {
			window.location.href = 'index';
		} else {
			alert(data);
		}
	}
	</script>

  </head>
  
  <body>
  	<div id="loginField" style="background: url('img/login.png');">
	    <form id="loginForm" method="post">
	    	<table>
	    		<tr>
	    			<td>用户名：</td>
	    			<td><input type="text" name="name" class="inputStyle" /></td>
	    		</tr>
	    		<tr>
	    			<td>密&nbsp;&nbsp;码：</td>
	    			<td><input type="password" name="password" class="inputStyle" /></td>
	    		</tr>
	    		<tr>
	    			<td>验证码：</td>
	    			<td><input type="text" name="code" class="codeInputStyle" /><img src="image" class="imageStyle" /></td>
	    		</tr>
	    		<tr>
	    			<td colspan="2" class="buttonRow"><input type="button" onclick="login()" value="登录" />
	    			<input type="reset" value="重置" /></td>
	    		</tr>
	    	</table>
	    </form>
  	</div>
  </body>
</html>
